import request from '@/utils/request'

/**
 * 查询机构列表
 * @param {*} query 
 * @returns 
 */
export function listOrgan(query) {
    return request({
        url: '/organization/selectPage',
        method: 'get',
        params: query
    })
}


/**
 *  机构详情
 * @param {*} query 
 * @returns 
 */
export function detailOrgan(query) {
    return request({
        url: '/organization/getDetail',
        method: 'get',
        params: query
    })
}

/**
 * 获取省市
 * @param {*} query 
 * @returns 
 */
export function getAreaTree(query) {
    return request({
        url: '/basicArea/getAreaByAreaCode',
        method: 'get',
        params: query
    })
}

/**
 * 
 * @param {*} query 
 * @returns 
 */
export function areaListTree(query) {
    return request({
        url: '/basicArea/areaListTree',
        method: 'get',
        params: query
    })
}



/**
 * 新增或修改
 * @param {*} data 
 * @returns 
 */
export function saveOrgan(data) {
    return request({
        url: '/organization/save',
        method: 'post',
        data,
    })
}

/**
 * 删除
 * @param {*} data 
 * @returns 
 */
export function delOrgan(data) {
    return request({
        url: '/organization/del',
        method: 'get',
        params:data,
    })
}


/**
 * 业务员添加跟踪记录
 * @param {*} data 
 * @returns 
 */
export function addOrganProcess(data) {
    return request({
        url: '/organization/addOrganizationProcess',
        method: 'post',
        data,
    })
}

/**
 * 机构账单分页列表
 * @param {*} get 
 * @returns 
 */
export function selectBillPage(data) {
    return request({
        url: '/organization/selectBillPage',
        method: 'get',
        params:data,
    })
}

/**
 * 充值记录分页列表
 * @param {*} data 
 * @returns 
 */
export function selectOrganizationRechargePage(data) {
    return request({
        url: '/organization/selectOrganizationRechargePage',
        method: 'get',
        params:data,
    })
}

/**
 * 消费记录分页列表
 * @param {*} data 
 * @returns 
 */

export function selectOrganizationConsumePage(data) {
    return request({
        url: '/organization/selectOrganizationConsumePage',
        method: 'get',
        params:data,
    })
}



/**
 * 投放计划列表
 * @param {*} data 
 * @returns 
 */
export function selectOrganizationPlanList(data) {
    return request({
        url: '/organization/selectOrganizationPlanList',
        method: 'get',
        params:data,
    })
}




/**业务员添加投放计划
 * 
 * @param {*} data 
 * @returns 
 */
export function saveOrganizationPlan(data) {
    return request({
        url: '/organization/saveOrganizationPlan',
        method: 'POST',
        data,
    })
}


/**
 * 投放计划详情
 * @param {*} data 
 * @returns 
 */
export function getPlanDetail(data) {
    return request({
        url: '/organization/getPlanDetail',
        method: 'get',
        params:data,
    })
}

/**
 * 删除投放计划
 * @param {*} data 
 * @returns 
 */
export function delOrganizationPlan(data) {
    return request({
        url: '/organization/delOrganizationPlan',
        method: 'get',
        params:data,
    })
}


/**
 * 启用禁用投放计划
 * @param {*} data 
 * @returns 
 */
export function updateStatusOrganizationPlan(data) {
    return request({
        url: '/organization/updateStatusOrganizationPlan',
        method: 'get',
        params:data,
    })
}




/**
 * 跟踪记录列表
 * @param {*} data 
 * @returns 
 */
export function selectOrganizationProcessPage(data) {
    return request({
        url: '/organization/selectOrganizationProcessPage',
        method: 'get',
        params:data,
    })
}

/**
 * 财务充值
 * @param {*} data 
 * @returns 
 */
export function addOrganizationRecharge(data) {
    return request({
        url: '/organization/addOrganizationRecharge',
        method: 'post',
        data,
    })
}




/**
 * 订单列表
 * @param {*} data 
 * @returns 
 */
export function selectOrderList(data) {
    return request({
        url: '/orderInfo/selectPage',
        method: 'get',
        params: data,
    })
}


/**
 * 订单详情
 * @param {*} data 
 * @returns 
 */
export function getOrderDetail(data) {
    return request({
        url: '/orderInfo/getDetail',
        method: 'get',
        params: data,
    })
}
/**
 * 渠道列表
 * @param {*} data 
 * @returns 
 */
export function selectChannelPage(data) {
    return request({
        url: '/channelInfo/selectPage',
        method: 'get',
        params: data,
    })
}


/**
 * 查看所有机构用户列表
 * @param {*} data 
 * @returns 
 */
export function selectAllOrgUser(data) {
    return request({
        url: '/organization/selectAllOrgUser',
        method: 'get',
        params: data,
    })
}




/**
 * 管理员推送用户给这个机构下的投放计划生成订单
 * @param {*} data 
 * @returns 
 */

export function pushUserInfoBindPlan(data) {
    return request({
        url: '/orderInfo/pushUserInfoBindPlan',
        method: 'get',
        params: data,
    })
}



/**
 * 每日日报
 * @param {*} data 
 * @returns 
 */

export function selectHomeDaily(data) {
    return request({
        url: '/organization/selectHomeDaily',
        method: 'get',
        params: data,
    })
}

export function selectTotalOrganizationDailyPage(data) {
    return request({
        url: '/organization/selectTotalOrganizationDailyPage',
        method: 'get',
        params: data,
    })
}




/**
 * 更改机构用户启用禁用
 * @param {*} data 
 * @returns 
 */
export function updateOrgUserStatus(data) {
    return request({
        url: '/organization/updateOrgUserStatus',
        method: 'get',
        params: data,
    })
}


/**
 * 重置密码
 * @param {*} data 
 * @returns 
 */

export function resetOrgUser(data) {
    return request({
        url: '/organization/resetOrgUser',
        method: 'get',
        params: data,
    })
}


/**
 * 撞库分析
 * @param {*} data 
 * @returns 
 */
export function selectFenXiPage(data) {
    return request({
        url: '/orderInfo/selectFenXiPage',
        method: 'get',
        params: data,
    })
}


/**
 * 获取首页统计
 * @param {*} data 
 * @returns 
 */
export function getHomeStart(data) {
    return request({
        url: '/orderInfo/getHomeStat',
        method: 'get',
        params: data,
    })
}

/**
 * 推广计划分析最近10天
 * @param {*} data 
 * @returns 
 */
export function getPlanLast(data) {
    return request({
        url: '/orderInfo/planLast10',
        method: 'get',
        params: data,
    })
}


/**
 * 消耗金额分析最近10天
 * @param {*} data 
 * @returns 
 */
export function getAmountLast(data) {
    return request({
        url: '/orderInfo/amountLast10',
        method: 'get',
        params: data,
    })
}



export function getPushStat(data) {
    return request({
        url: '/orderInfo/getPushStat',
        method: 'get',
        params: data,
    })
}


